﻿<UserControl x:Class="NDasm.Core.UI.DasmView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Tree="clr-namespace:NDasm.Core.UI.Tree" xmlns:MethodDasm="clr-namespace:NDasm.Core.UI.MethodDasm">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="150" Width="200"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Tree:AssemblyTreeView Grid.Column="0" DataContext="{Binding AssemblyTree}"/>
        <GridSplitter Grid.Column="1" ResizeBehavior="PreviousAndNext" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
        <MethodDasm:MethodDasmView Grid.Column="2" DataContext="{Binding MethodDasm}">
            <MethodDasm:MethodDasmView.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding DataContext, RelativeSource={RelativeSource Self}}" Value="{x:Null}">
                            <Setter Property="UserControl.Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </MethodDasm:MethodDasmView.Style>
        </MethodDasm:MethodDasmView>
        <TextBlock Text="Please select a method" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16" Grid.Column="2" Foreground="Gray">
            <TextBlock.Style>
                <Style>
                    <Setter Property="UserControl.Visibility" Value="Collapsed"/>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding MethodDasm}" Value="{x:Null}">
                            <Setter Property="UserControl.Visibility" Value="Visible"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
    </Grid>
</UserControl>